home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / fgl110c.zip / 13-07.C < prev    next >
Text File  |  1992-01-31  |  633b  |  36 lines

  1. #include <fastgraf.h>
  2.  
  3. void main(void);
  4.  
  5. #define ESC 27
  6.  
  7. void main()
  8. {
  9.    int color;
  10.    int old_mode;
  11.    unsigned char key, aux;
  12.  
  13.    old_mode = fg_getmode();
  14.    fg_setmode(fg_automode());
  15.    color = 0;
  16.  
  17.    fg_musicb("O4 L16 CC#DD#EFF#GG#AA#B O+ CC#DD#EFF#GG#AA#B$",-1);
  18.  
  19.    while (fg_playing())
  20.    {
  21.       color = (color + 1) & 15;
  22.       fg_setcolor(color);
  23.       fg_rect(0,fg_getmaxx(),0,fg_getmaxy());
  24.  
  25.       fg_waitfor(4);
  26.       fg_intkey(&key,&aux);
  27.       if (key == ESC)
  28.          fg_hush();
  29.       else if (key+aux != 0)
  30.          fg_hushnext();
  31.    }
  32.  
  33.    fg_setmode(old_mode);
  34.    fg_reset();
  35. }
  36.